﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace DeliveryService
{
    public class BLBrands
    {
        public List<MBrands> GetBrandsByGoodsSmallCategoryName(string goodsSmallCategoryName)
        {
            using (DeliveryDBDataContext db = new DeliveryDBDataContext())
            {
                var query = db.Brand_GoodsCategory_s.Where(s => s.Goodscategory_.GoodsCategory_S_Name.Contains(goodsSmallCategoryName))
                    .Select(s => new MBrands
                    {
                        Id = s.Brand.Brand_ID,
                        BrandName = s.Brand.Brand_Name
                    });
                return query.ToList();
            }
        }
    }

}